home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / newmake.arc / MAKE.MAN < prev    next >
Text File  |  1986-09-21  |  8KB  |  297 lines

  1. MAKE(I)             3/10/84                 MAKE(I)
  2.  
  3.  
  4.  
  5. NAME
  6.     MAKE - maintain multiple source files (VAX/VMS and MSDOS 2.0)
  7.  
  8.  
  9. SYNOPSIS
  10.     MAKE [-N] [-A] [-F makefile] [name ...]
  11.  
  12.  
  13. DESCRIPTION
  14.     MAKE is a utility inspired by the Unix(tm) command of the same
  15.     name.  MAKE helps maintain programs that are constructed from
  16.     many files.  MAKE processes a "makefile", a file which describes
  17.     how to build a program from its source files, and produces a
  18.     script file containing the commands necessary to recompile the
  19.     program.
  20.  
  21.     Be careful: this MAKE is NOT compatible with Unix(tm) MAKE!
  22.  
  23.     The 'N' option causes MAKE to print out the steps it would follow
  24.     in order to rebuild the program.  The 'A' option tells MAKE to
  25.     assume that all files are obsolete, and that everything should be
  26.     recompiled.  The 'F' option, followed by a filename, can be used
  27.     to specify a makefile other than the default one.
  28.  
  29.     If no names are specified in the commandline, the first dependency
  30.     in the makefile is examined.  Otherwise, the specified root names
  31.     are brought up to date.
  32.  
  33.     The default makefiles are:
  34.  
  35.         for VAX/VMS:    MAKEFILE
  36.                 [-]MAKEFILE
  37.                 SYS$LOGIN:MAKEFILE
  38.  
  39.         for MSDOS:    MAKEFILE
  40.                 ..\MAKEFILE
  41.  
  42.     If the first makefile cannot be found, MAKE attempts to use the
  43.     next one.  If no makefile is ever found, MAKE prints a diagnostic
  44.     and aborts.
  45.  
  46.  
  47.  
  48.  
  49.  
  50. THE MAKEFILE
  51.     Comments begin with '!' and extend to the end of the line.  A
  52.     '!' (or almost any other character) may be escaped with the escape
  53.     character (backslash (\) on VMS, backquote (`) on MSDOS).  An escape
  54.     character may be typed by doubling it (\\ or ``).  The standard
  55.     Unix escape codes are recognized (\n, \r, \t, \b, \f, `n, `r, `t,
  56.     `b and `f).
  57.  
  58.     A makefile is a list of dependencies.  A dependency consists of
  59.     a root name, a colon, and zero or more names of dependent files.
  60.     (The colon MUST be preceeded by whitespace.)  For instance, in:
  61.  
  62.         make.exe : make.obj parsedir.obj file.obj macro.obj mk.h
  63.  
  64.     the file 'make.exe' depends on five other files.  A root name
  65.     with an empty dependency, as in:
  66.  
  67.         print :
  68.  
  69.     is assumed NEVER up to date, and will always be recompiled.
  70.  
  71.     The dependency list may be continued on successive lines:
  72.  
  73.         bigfile.exe : one.obj two.obj three.obj four.obj
  74.         five.obj six.obj gronk.obj freeple.obj scuzzy.lnk
  75.         frog.txt greeble.out
  76.  
  77.     Any number of 'method' lines may follow a dependency.  Method lines
  78.     begin with an ascii tab.  When a file is to be recompiled, MAKE
  79.     copies these method lines (minus the tab) to the script file.
  80.     For example, in:
  81.  
  82.         make.exe : make.obj parsedir.obj file.obj macro.obj mk.h
  83.             $link make, parsedir, file, macro
  84.             $write sys$output "Just another version of MAKE ..."
  85.             $purge
  86.  
  87.     the three lines following the dependency make up the method for
  88.     recompiling (or in this case, re-linking) the file 'make.exe'.
  89.  
  90.     If the macro "~INIT" is defined, its text will appear first in the
  91.     script file.  If the macro "~DEINIT" is defined, its text will
  92.     appear last in the script file.  By defining these two macros, it
  93.     is possible to configure the shell enviroment:
  94.  
  95.         ~INIT = $set term/nowrap\n$on error then goto err_handler
  96.         ~DEINIT = $set term/wrap\n$exit\$err_handler:\n
  97.         ~DEINIT = #(~DEINIT)$type err.log\n$exit
  98.  
  99.     will expand (in the script file) to:
  100.  
  101.         $set term/nowrap
  102.         $on error then goto err_handler
  103.         .
  104.         .
  105.         $set term/wrap
  106.         $exit
  107.         $err_handler:
  108.         $type err.log
  109.         $exit
  110.  
  111.     When a root's method is defined, the value of the macro "~BEFORE"
  112.     is prefixed to the method, and the value of the macro "~AFTER" is
  113.     appended to it.
  114.  
  115.     Frequently one wants to maintain more than one program with a single
  116.     makefile.  In this case, a "master dependency" can appear first in
  117.     the file:
  118.  
  119.         allOfMyToolsAndHorribleHacks : cat peek poke.exe grunge
  120.         cat : cat.exe
  121.         cat.exe : ....
  122.             (stuff for CAT.EXE)
  123.         peek : peek.exe
  124.         peek.exe : (stuff for PEEK.EXE)
  125.         poke.exe : (stuff for POKE.EXE)
  126.         grunge : grunge.com
  127.         grunge.com : (stuff for grung)
  128.  
  129.     In other words, make will bring everything up to date that is somehow
  130.     connected to the first dependency (its assumed that the incredibly
  131.     lengthy filename specified in this example won't actually exist).
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141. MACROS
  142.     A macro is defined by a line of the form (the '=' MUST be surrounded
  143.     by whitespace):
  144.  
  145.         <macro-name> = <macro-body>
  146.  
  147.     A macro may be deleted by assigning an empty value to it.  Macros
  148.     may be redefined, but old definitions stay around.  If a macro is
  149.     redefined, and the redefinition is later deleted, the first definition
  150.     will take effect:
  151.  
  152.         MAC = first            ! MAC = "first"
  153.         MAC = second            ! MAC = "second"
  154.         MAC = #(MAC) third        ! MAC = "second third"
  155.         MAC =                ! MAC = "second"
  156.         MAC =                ! MAC = "first"
  157.         MAC =                ! MAC has no definition
  158.  
  159.     A macro may be referenced in two ways:
  160.  
  161.             #<char>   or    #(macro-name)
  162.  
  163.     The first way only works if the macro's name is a single character.
  164.     If the macro's name is longer than one character, it must be
  165.     enclosed in parenthesis.  ['#' may be escaped by doubling it ("##".)]
  166.     For example, in:
  167.  
  168.         G = mk.h mk1.h
  169.         OBJS = make.obj file.obj parsedir.obj macro.obj
  170.         BOTH = #(OBJS) #G
  171.  
  172.         make.exe : #(OBJS) #G
  173.         make.exe : #(BOTH)
  174.         make.exe : mk.h mk1.h make.obj file.obj parsedir.obj macro.obj
  175.             $write sys$output "This is a number sign --> ##"
  176.  
  177.     after macro expansion, the three dependencies will appear identical
  178.     and the two '#'s in the last line will turn into one '#'.
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. UNIX(tm) MAKE AND THIS ONE
  190.     They are NOT the same.    Do not expect Unix makefiles to work with
  191.     this MAKE, even if you change the pathnames.  There are some major
  192.     differences between this version and the standard Unix(tm) MAKE:
  193.  
  194.     1. The Unix(tm) comment character is '#', VAX/VMS's is '!'.
  195.  
  196.     2. The Unix(tm) macro-expansion character is '$'.  While this would
  197.        have been easy to leave the same, the '$' character is used so
  198.        often in VAX/VMS command-lines that I thought it best to change
  199.        it to '#'.
  200.  
  201.     3. Multiple root names are not allowed.  Unix(tm) MAKE accepts lines
  202.        of the form:
  203.  
  204.         name1 name2 : depend1 depend2
  205.  
  206.        but this one doesn't.
  207.  
  208.     4. There is no equivalent of double-colon ("::".)
  209.  
  210.     5. There is no equivalent of .SUFFIXES, or the corresponding special
  211.        macros.
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237. SAMPLE MAKEFILE
  238.     !
  239.     ! VAX/VMS MAKE
  240.     ! Landon Dyer
  241.     !
  242.     H = make.h
  243.     FILES = #H, make.c, macro.c, token.c, parsedir.c, file.c
  244.     DOCUMENTATION = distr.mem make.man makefile. make.com
  245.  
  246.     make.exe : make.obj macro.obj token.obj parsedir.obj file.obj
  247.         $link make.obj, macro, token, parsedir, file
  248.         $purge
  249.  
  250.     make.obj : make.c #H
  251.         $cc make.c
  252.  
  253.     macro.obj : macro.c #H
  254.         $cc macro
  255.  
  256.     token.obj : token.c #H
  257.         $cc token
  258.  
  259.     parsedir.obj : parsedir.c #H
  260.         $cc parsedir
  261.  
  262.     file.obj : file.c
  263.         $cc file
  264.  
  265.     !
  266.     ! Print files associated with MAKE
  267.     !
  268.     print :
  269.         $print make.man, #(FILES), make.com, makefile.
  270.  
  271.     !
  272.     ! Type out source to MAKE
  273.     !
  274.     type :
  275.         $type #(FILES), make.com, makefile.
  276.  
  277.     !
  278.     ! Make backup of source files.
  279.     !
  280.     BACKUP = [.bak]
  281.     backup :
  282.         $copy #(FILES) #(BACKUP)
  283.         $copy make.man, make.com, makefile. #(BACKUP)
  284.  
  285.     !
  286.     ! Collect MAKE into a distribution file.
  287.     !
  288.     collect :
  289.         $collect collect distr.mem make.man makefile make.com make.h -
  290.             make.c macro.c token.c parsedir.c file.c
  291.  
  292.  
  293. AUTHOR
  294.     Landon Dyer            G.DYER@SU-SCORE.ARPA
  295.     175 Calvert Dr. #F-211        BASHFL::DYER (Atari Coinop)
  296.     Cupertino, CA 95014
  297.